package ch07_GUI编程;

import javax.swing.*;
import java.awt.*;

public class JLabelDemo {
	public static void main(String[] args) {
		BaseFrame f =new BaseFrame("JLable Demo");
		f.setLayout(new GridLayout(3,1));

		JLabel l1=new JLabel("普通标签");
		JLabel l2=new JLabel("指定字体并靠右下对齐的标签");
		l2.setFont(new Font("方正姚体",Font.BOLD,18));
		l2.setOpaque(true);
		l2.setBackground(Color.LIGHT_GRAY);
		l2.setForeground(Color.white);
		l2.setHorizontalAlignment(SwingConstants.RIGHT);
		l2.setVerticalAlignment(SwingConstants.BOTTOM);

		String s = "<html>带<font size=6>HTML</font><i>标记的</i><sub>标签</sub></html>";
		JLabel l3=new JLabel(s);

		f.add(l1);
		f.add(l2);
		f.add(l3);
		f.showMe();
	}
}
